package com.azure.bigstore;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.Ordered;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@SpringBootApplication
public class BigstoreApplication extends WebMvcConfigurerAdapter {

	public static void main(String[] args) {
		SpringApplication.run(BigstoreApplication.class, args);
	}


	@Override
	public void addViewControllers(ViewControllerRegistry registry) {
		System.out.println("<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>");
		registry.addRedirectViewController("/admin", "/admin/login.html");
		registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
		super.addViewControllers(registry);
	}

}
